﻿using System.Collections.Generic;
/**
{ "multicast_id": 216,
  "success": 3,
  "failure": 3,
  "canonical_ids": 1,
  "results": [
    { "message_id": "1:0408" },
    { "error": "Unavailable" },
    { "error": "InvalidRegistration" },
    { "message_id": "1:1516" },
    { "message_id": "1:2342", "registration_id": "32" },
    { "error": "NotRegistered"}
  ]
}
 **/
namespace FollowMe.GCM
{
    public class GCMResponse
    {
        public string multicast_id { get; set; }
        public bool success { get; set; }
        public int failure { get; set; }
        public string canonical_ids { get; set; }
        public IEnumerable<IDictionary<string, string>> results { get; set; }//unpredictable format.  Maybe save as a string instead, pass it back to deserialize.
    }
}

/**
 * GCM provides a facility called "canonical registration IDs" to easily recover from these situations. 
 * A canonical registration ID is defined to be the ID of the last registration requested by your application. 
 * This is the ID that the server should use when sending messages to the device.
 * 
 * If later on you try to send a message using a different registration ID, GCM will process the request as usual,
 * but it will include the canonical registration ID in the registration_id field of the response. 
 * Make sure to replace the registration ID stored in your server with this canonical ID, 
 * as eventually the ID you're using will stop working.
 **/
